#ifndef SCENE_MANAGER_H
#define SCENE_MANAGER_H

#include "d3dUtil.h"
#include "ResourcesManager.h"
#include "Node.h"
#include "Camera.h"
#include "LightEffects.h"
#include "Light.h"

class SceneManager
{
public:
	SceneManager();
	~SceneManager(void);

	void RenderOneFrame();
	void UpdateScene();

	void Init(ID3D10Device* device);

	Node* CreateNode(std::string name);
	Node* GetNodeByName(std::string name);
	Node* GetRootNode();

	//set xx method
	void SetViewMatrix(const D3DXMATRIX& matrix);
	void SetProjMatrix(const D3DXMATRIX& matrix);
	void SetEyePosition(const D3DXVECTOR3& pos);

	//get xx method
	Camera& GetMainCamera();

private:
	void SetEffectState();
	void CreateParallelLight();

private:
	ID3D10Device*					m_pDevice;
	Node							m_rootNode;

	std::map<std::string,Node*>		m_nodeMap;
	Effect::LightEffects			m_lightEffect;

	D3DXMATRIX						m_matView;
	D3DXMATRIX						m_matProj;
	D3DXMATRIX						m_matWVP;
	
	Light							m_ParallelLight;

	D3DXVECTOR3						m_vEyePosition;

	ID3D10ShaderResourceView*		m_pSpecMapRV;

	Camera							m_MainCamera;
};

#endif